package com.hassean.wemongoservice.service.impl;

import com.hassean.wemongoservice.entity.UnifiedLocationInfo;
import com.hassean.wemongoservice.service.UnifiedLocationInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoOperations;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @ProjectName: root
 * @Package: com.hassean.wemongoservice.service.impl
 * @ClassName: UnifiedLocationInfoServiceImpl
 * @Description:
 * @Author: 张晓龙
 * @CreateDate: 2019/03/04 15:27
 * @UpdateUser: 更新者
 * @UpdateDate: 2019/03/04 15:27
 * @UpdteRemark: 更新说明
 * @Version: 1.0
 */
@Service("unifiedLocationInfoService")
@Slf4j
public class UnifiedLocationInfoServiceImpl implements UnifiedLocationInfoService {

    @Autowired
    private MongoTemplate mongoTemplate;
    /**
     * 增加轨迹信息
     *
     * @param unifiedLocationInfo
     */
    @Override
    public void insert(UnifiedLocationInfo unifiedLocationInfo) {
        log.info("开始插入数据...");
        mongoTemplate.save(unifiedLocationInfo,unifiedLocationInfo.getClass().getName());
        log.info("插入数据完成....");
    }
}
